Skip to content

fix(docs): 修复 vite.config 插件类型 TS2321 堆栈过深 - #21

Merged
vaebe merged 1 commit into
mainfrom
fix/docs-vite-config-plugin-type
Jun 8, 2026
Merged

fix(docs): 修复 vite.config 插件类型 TS2321 堆栈过深#21
vaebe merged 1 commit into
mainfrom
fix/docs-vite-config-plugin-type

Conversation

@vaebe

@vaebe vaebe commented Jun 8, 2026

Copy link
Copy Markdown
Owner

vueJsx 内置的 @vitejs/plugin-vue 把 vite peer 浮动到 vite-plus-core@0.1.21, 与 defineConfig 期望的 0.1.20 Plugin 类型族冲突。将 vueJsx() 归一到 vite 导出的 PluginOption 即可消除,其余插件保持类型推断。

Summary by CodeRabbit

  • Chores
    • Updated build configuration to resolve TypeScript type compatibility issues, ensuring more reliable builds for documentation.

vueJsx 内置的 @vitejs/plugin-vue 把 vite peer 浮动到 vite-plus-core@0.1.21,
与 defineConfig 期望的 0.1.20 Plugin 类型族冲突。将 vueJsx() 归一到
vite 导出的 PluginOption 即可消除,其余插件保持类型推断。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 12e952ed-51da-4811-8b3e-7745970e4773

📥 Commits

Reviewing files that changed from the base of the PR and between eade608 and 77141df.

📒 Files selected for processing (1)
  • packages/docs/vite.config.ts

Walkthrough

This PR fixes a TypeScript type mismatch in the Vite configuration for the docs package by adding a PluginOption type import and casting the vueJsx() plugin to that type, with inline comments explaining the conflict resolution.

Changes

Vite vueJsx plugin type resolution

Layer / File(s) Summary
Plugin type import and cast
packages/docs/vite.config.ts
Added type-only PluginOption import from vite and cast vueJsx() to PluginOption in the plugins array to resolve TS2321 stack depth conflict, with explanatory comments documenting the type-family resolution.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A Vite config's type was twisted,
So PluginOption was enlisted!
The vueJsx now casts with grace,
TypeScript smiles at this place.
One import, one cast—conflict dismissed! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: fixing a TypeScript TS2321 type error in the Vite config by casting the vueJsx plugin to the PluginOption type.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/docs-vite-config-plugin-type

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vaebe
vaebe merged commit b9ccfb6 into main Jun 8, 2026
3 of 4 checks passed
@vaebe
vaebe deleted the fix/docs-vite-config-plugin-type branch June 8, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant